package thread;

import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

public class SleepDemo2 {
    public static void main(String[] args) {
        Thread wang=new Thread("王"){
            public void run(){
                System.out.println(getName()+"打排位输了,气死我了晕了");
                try {
                    Thread.sleep(10000);
                } catch (InterruptedException e) {
                    System.out.println(getName()+"他蜡笔的干嘛呢,真烦");
                }
                System.out.println(getName()+"醒了");
            }
        };
        Thread feng=new Thread("冯"){
          public void run(){
              System.out.println(getName()+":三国杀!");
              for (int i=5;i>0;i--){
                  System.out.println(getName()+":出杀");
                  try {
                      Thread.sleep(1000);
                  } catch (InterruptedException e) {
                      e.printStackTrace();
                  }
              }
              System.out.println(getName()+":赢了!啊啊啊啊");
              wang.interrupt();
          }
        };
        wang.start();
        feng.start();


    }
}
